from appium.webdriver import Remote
# from appium.webdriver.webdriver import By
# 得到一个driver对象
# 确保手机在线 通过adb devices
# 启动appipm服务
# 如果appipm访问4444端口，可以不传参数

# caps = {
#     'platformName': 'Android',
#     'deviceName': 'emulator-5554',
#     'app': r'C:\测试文件\__UNI__E090861__20220808095306.apk'
# }
# driver = Remote(command_executor="http://127.0.0.1:4723/wd/hub",
#                 desired_capabilities=caps)


caps = {
    'platformName': 'Android',
    'deviceName': 'emulator-5554',
    'app': r'C:\test data\__UNI__E090861__20220808095306.apk',
    'appPackage': 'com.hijyun.property',
    'appActivity': 'io.dcloud.PandoraEntry',
    'platformVersion': '7.1.2',
    'automationName': 'Appium',
    'noReset': False,
    'unicodeKeyboard': True,
    'resetKeyboard': True,
    'autoGrantPermissions': True
}
driver = Remote(command_executor="http://127.0.0.1:4723/wd/hub",
                desired_capabilities=caps)
driver.implicitly_wait(10)
#
# driver.find_element(By.ID, "com.hijyun.property:id/btn_custom_privacy_sure").click()
# driver.find_element(By.CLASS_NAME, "android.widget.EditText").send_keys("https.//yunyan-test.frp.xxbu.cn")
# driver.find_element(By.XPATH, "//*[@text = '下一步']")
driver.quit()